import {Component, OnInit} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {PlatformService} from "../platform.service";
import {SettingUrl} from "../../../public/setting/setting_url";

@Component({
  selector: 'app-platform-account-detail',
  templateUrl: './platform-account-detail.component.html',
  styleUrls: ['./platform-account-detail.component.css']
})
export class PlatformAccountDetailComponent implements OnInit {
  private code: string;
  public platformAccountInfo: any = {};//platformAccount信息

  constructor(private platformService: PlatformService, private route: ActivatedRoute, private router: Router) {
  }

  ngOnInit() {
    this.code = this.route.snapshot.params.code;//获取参数
    this.loadPlatformAccountInfo();//查询platformAccount类型列表
  }

  /**
   * 查询platformAccount信息
   */
  loadPlatformAccountInfo() {
    this.platformService.loadPlatformAccountByCode(this.code).then((data: any) => {
      if (data) this.platformAccountInfo = data;
    })
  }
}
